package com.liug.droidsmall2.adapter;

import android.content.Context;
import android.support.v4.app.FragmentActivity;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.liug.droidsmall2.R;

import java.util.ArrayList;

/**
 * Created by LG on 2018/7/31.
 */
public class HomeTabAdapter extends RecyclerView.Adapter {
    private static final int HEAD = 1;
    private static final int CONTENTQ = 2;
    Context context;
    private ArrayList<String> list_path;
    private ArrayList<String> list_title;
    FragmentActivity fragment;

    public HomeTabAdapter(Context context) {
        this.context = context;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View inflate = View.inflate(context, R.layout.home_tab_adapter_item, null);
        return new Holder(inflate);
    }


    @Override
    public int getItemViewType(int position) {
        return CONTENTQ;
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        int itemViewType = getItemViewType(position);

        Holder holder1 = (Holder) holder;
        if (itemViewType == CONTENTQ) {
            Glide.with(context).load(R.mipmap.icon12) //.transform(new GlideRoundTransform(context, 80))
                    .into(holder1.img);
        }
    }


    @Override
    public int getItemCount() {
        return 10;
    }

    class Holder extends RecyclerView.ViewHolder {

        private final ImageView img;

        public Holder(View itemView) {
            super(itemView);
            img = (ImageView) itemView.findViewById(R.id.img);

        }
    }
}
